{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">用户积分管理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="{:url('admin/integral/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">用户名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="userName" value="{$userName}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">用户手机</label>
                        <div class="layui-input-inline">
                            <input type="text" name="userPhone" value="{$userPhone}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>

                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>用户ID</th>
                        <th>用户名称</th>
                        <th>用户手机</th>
                        <th>积分</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="integral_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.userID}</td>
                        {foreach $user_list as $ul}
                            {if $ul.id == $vo.userID}
                                <td>{$ul.name}</td>
                                <td>{$ul.phone}</td>
                            {/if}
                        {/foreach}
                        <td>{$vo.userIntegral}</td>
                        <td>
                            <a href="{:url('admin/integral/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$integral_list->render()}
            </div>
        </div>
    </div>
</div>
{/block}